package com.dp.util;



import java.util.ArrayList;
import java.util.HashMap;


public class DataMap extends HashMap {
	public String getMapData(Object key,int length)
	{
		String str=BaseBean.ObjectToString(this.get(key));
		try{
			return str.substring(0,length);
		}
		catch (Exception e) {
			return str;
        }
	}
	public String getMapData(Object key,int length,String tail)
	{
		String str=BaseBean.ObjectToString(this.get(key));
		try{
			return str.substring(0,length)+tail;
		}
		catch (Exception e) {
			return str;
        }
	}
	public String getMapData(Object key,String regex,String replacement)
	{
		String str=BaseBean.ObjectToString(this.get(key));
		return str.replaceAll(regex, replacement);
		
	}
    public String getMapData(Object key) {
    	
        return BaseBean.ObjectToString(this.get(key));
    }

    public int getMapint(Object key) {
        return BaseBean.getint(this.get(key));
    }

    public long getMaplong(Object key) {
        return BaseBean.getlong(this.get(key));
    }

    public float getMapfloat(Object key) {
        return BaseBean.getfloat(this.get(key));
    }

    public double getMapdouble(Object key) {
        return BaseBean.getdouble(this.get(key));
    }
    public ArrayList getList(Object key)
    {
    	if(containsKey(key))
    	{
    		return (ArrayList)get(key);
    	}
        return new ArrayList();
    }

   
}
